Skip to content

Add chronological fallback logging for chat and responses#313

Open
JammyJames1234 wants to merge 4 commits into
tashfeenahmed:mainfrom
JammyJames1234:feat/request-group-logging
Open

Add chronological fallback logging for chat and responses#313
JammyJames1234 wants to merge 4 commits into
tashfeenahmed:mainfrom
JammyJames1234:feat/request-group-logging

Conversation

@JammyJames1234

Copy link
Copy Markdown

Fixes #305

What changed

  • Add concise chronological terminal logging for /v1/chat/completions
  • Add concise chronological terminal logging for /v1/responses
  • Log attempt start, fail, fallback, and success for each request
  • Include timestamp, short request id, attempt number, provider, routed model, latency, and tokens where available
  • Keep X-Request-ID response headers for correlation

Why

The existing logs showed failures and fallbacks, but were hard to follow for one request in chronological order. This change makes it easier to see which provider/model was actually attempted and which fallback succeeded.

Example

[server] [Proxy] 2026-06-13T21:31:41.330Z start 9d5d82 a0 ollama - cogito-2.1:671b req=auto
[server] [Proxy] 2026-06-13T21:31:42.646Z ok 9d5d82 a0 ollama - cogito-2.1:671b lat=1317ms in=34 out=66
[server] [Proxy] 2026-06-13T21:32:00.291Z start 270227 a0 ollama - gpt-oss:20b req=gpt-oss:20b
[server] [Proxy] 2026-06-13T21:32:01.750Z fail 270227 a0 ollama - gpt-oss:20b lat=1460ms err="empty completion"
[server] [Proxy] 2026-06-13T21:32:01.751Z next 270227 a1 ollama - cogito-2.1:671b
[server] [Proxy] 2026-06-13T21:32:03.248Z ok 270227 a1 ollama - cogito-2.1:671b lat=2958ms in=107 out=75
[server] [Proxy] 2026-06-13T21:32:28.659Z start 1be1af a0 mistral - codestral-latest req=codestral-latest
[server] [Proxy] 2026-06-13T21:32:28.938Z ok 1be1af a0 mistral - codestral-latest lat=281ms in=8 out=15

Tests

  • Updated route tests for proxy/responses logging behavior
  • Ran targeted server route tests successfully

Notes

  • No net database/schema change in the final diff
  • No analytics/UI changes
  • npm run build -w server currently reports pre-existing module/type resolution issues unrelated to this change (undici, socks-proxy-agent)

@JammyJames1234

Copy link
Copy Markdown
Author

Tested locally and confirmed the new compact chronological logs for both successful requests and fallback attempts.

Note: GitHub Actions shows 2 workflows awaiting maintainer approval because this PR comes from a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: detailed logging so we know which models are good with tool use etc

1 participant